home *** CD-ROM | disk | FTP | other *** search
- #include "defines.h"
- #include "includes.h"
-
- void startplayer(char *dir, char *file)
- {
- int x;
- char *params[20];
-
- for (x=0;x<20;++x) params[x]=calloc(1,256);
-
- strcat(params[0],playerdir);
- strcat(params[0],"/");
- strcat(params[0],player);
-
- strcat(params[1],player);
-
- for (x=0;playerflags[x]!=(char *)NULL;++x) strcpy(params[x+2],playerflags[x]);
-
- strcpy(params[x+2],dir);
- strcat(params[x+2],"/");
- strcat(params[x+2],file);
-
- params[x+3]=0;
-
- freopen(playeroutput,"a+",stdin);
- freopen(playeroutput,"a+",stdout);
- freopen(playeroutput,"a+",stderr);
-
- if (execv(params[0],¶ms[1])==-1) perror("execv");
- }
-